package com.hhcn.friend;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * Created by Administrator on 2018/5/25.
 */
public class FriendMap extends Mapper<Text,Text,Text,Text> {

    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
        String ketStr = key.toString();
        String valueStr = value.toString();
        if (ketStr.compareTo(valueStr) < 0) {
            context.write(key, value);
        } else {
            context.write(value,key);
        }
    }

}
